﻿using System;
using System.Collections.Generic;

namespace ebc.patterns.rx.pins
{
    public class OutputPin<T> : IObservable<T>
    {
        private readonly Subject<T> wire = new Subject<T>();


        public void Post(T message)
        {
            this.wire.OnNext(message);
        }


        public IDisposable Subscribe(IObserver<T> observer)
        {
            return this.wire.Subscribe(observer);
        }
    }
}
